home *** CD-ROM | disk | FTP | other *** search
Makefile | 1998-12-03 | 11.5 KB | 320 lines | [TEXT/MPS ] |
- # File MakeFile - Make instructions for C examples.
- #
- # Copyright Apple Computer, Inc. 1986-1995, 1998
- # All rights reserved.
- #
- # This makefile builds:
- # The sample C tool: Count
- # The sample desk accessory: Memory
- # The sample performance tool: TestPerf
- # The sample CDev: EditCDev
- # The sample application: Sample
- # The sample application: SillyBalls
- # The sample application: TubeTest
- # The sample TE application: TESample
- #
-
- # You can define {SymOptions} as "-sym on" or "-sym off" for use with SADE
- # We also recommend requiring prototypes for all functions
-
- SymOptions = -sym Full
- SymOpt = {SymOptions}
- COptions = -w 17 -proto strict {SymOpt} -D OLDROUTINELOCATIONS=0
- MrCOptions = {SymOpt} -D OLDROUTINELOCATIONS=0
-
- # The following variable is used to define the ROM map file used by the
- # TestPerf component. If necessary, you can change this to point to the
- # proper location of your machine's ROM map.
-
- RomMapLoc = {MPW}ROM Maps:
- RomMap = Mac`gestalt mach -s`ROM.map
-
-
- # Dummy rule for building all of the samples
-
- all ƒ Count Memory TestPerf EditCDev Sample SillyBalls TESample TubeTest
-
- #######################################################################
- # Build instructions and dependencies for the Count tool
- #
-
- VERSION = "3.4d2"
-
- .c.x ƒ .c
- MrC {Default}.c -o {Default}.c.x {MrCOptions}
-
- Count ƒƒ Count.ppc Count.68k
- duplicate -y Count.ppc {Targ}
- duplicate -y -r Count.68k {Targ}
- Rez Count.r GenericCFRG.r -o Count -append -d APPNAME=∂"Count∂"
- SetVersion -t 'vers' -i 1 -version "{VERSION}" Count
- SetFile -m . -c 'MPS ' -t MPST Count
-
- Count.ppc ƒ Count.c.x Count.r GenericCFRG.r
- PPCLink -d -c 'MPS ' -t MPST {SymOpt} ∂
- Count.c.x ∂
- "{SharedLibraries}"StdCLib ∂
- "{SharedLibraries}"InterfaceLib ∂
- "{PPCLibraries}"StdCRuntime.o ∂
- "{PPCLibraries}"PPCCRuntime.o ∂
- "{PPCLibraries}"PPCToolLibs.o ∂
- -o {Targ}
-
- Count.68k ƒƒ Count.c.o Count.r GenericCFRG.r
- Link -d -c 'MPS ' -t MPST {SymOpt} -mf ∂
- Count.c.o ∂
- "{CLibraries}"StdClib.o ∂
- "{Libraries}"Stubs.o ∂
- "{Libraries}"IntEnv.o ∂
- "{Libraries}"MacRuntime.o ∂
- "{Libraries}"Interface.o ∂
- "{Libraries}"ToolLibs.o ∂
- -o {Targ}
-
-
- #######################################################################
- # Build instructions and dependencies for the Memory desk accessory
- #
-
- # The following two variables define the creator and type for the
- # Memory Desk Accessory. For System 6 compatibility, the build
- # instructions should create a "Suitcase" file containing the DA.
- # Suitcase files have a creator of 'DMOV' and a type of 'DFIL'. For
- # System 7 and newer, DA's can exist all by themselves, without being
- # wrapped in the "womb" of the Suitcase file. This makes it easier
- # to manipulate the DA file, since the Suitcase doesn't have to be
- # opened first. DA's can be treated just like any other application.
- # In this case, the creator should be 'movr' and the type should be
- # 'dfil' (note the difference in character case).
-
- DACreator = 'movr' # change to 'DMOV' for System 6 use
- DAType = 'dfil' # change to 'DFIL' for System 6 use
-
- Memory ƒƒ Memory.c.o DAEntry.a.o
- Link {SymOptions} -da -rt DRVR=12 ∂
- -m DAEntry -sg Memory # DAEntry is located in DAEntry.a.o ∂
- DAEntry.a.o # This must preceed DRVRRuntime.o ∂
- "{Libraries}"DRVRRuntime.o # This must preceed MacRuntime.o ∂
- Memory.c.o ∂
- "{Libraries}"MacRuntime.o ∂
- "{Libraries}"Interface.o ∂
- -o Memory -c {DACreator} -t {DAType}
-
- Memory ƒƒ Memory.r
- Rez -rd -c {DACreator} -t {DAType} Memory.r -a -o Memory
-
- Memory.NOASM ƒ Memory.DRVW Memory.r
- Rez -rd -c {DACreator} -t {DAType} -d NOASM_BUILD Memory.r -o Memory.NOASM
- Duplicate -y Memory.NOASM Memory
-
- Memory.DRVW ƒ Memory.c.o
- Link -w -rt DRVW=0 ∂
- -sg Memory ∂
- "{Libraries}"DRVRRuntime.o ∂
- Memory.c.o ∂
- "{Libraries}"IntEnv.o ∂
- "{Libraries}"MacRuntime.o ∂
- "{Libraries}"Interface.o ∂
- -o Memory.DRVW -c "????" -t "????"
-
-
- #######################################################################
- # Build instructions and dependencies for the TestPerf tool
- #
- # Warning: this sample won't build for machines which do not
- # have ROM maps (Power Macintoshes being notable examples).
-
- TestPerf ƒ TestPerf.c.o
- Link -d # suppress duplicate warnings ∂
- -o TestPerf -t MPST -c 'MPS ' ∂
- -l -la > TestPerf.map # produce link map file ∂
- TestPerf.c.o "{Libraries}"PerformLib.o ∂
- "{Libraries}"Interface.o ∂
- "{Libraries}"IntEnv.o ∂
- "{Libraries}"MacRuntime.o ∂
- "{CLibraries}"StdCLib.o
- Set ThisDir `Directory`
- Directory "{RomMapLoc}"
- Make "{RomMap}" >"{TempFolder}Make.Out" && ("{TempFolder}"Make.Out && Delete "{TempFolder}Make.out") || set status 0
- Directory "{ThisDir}"
- Unset ThisDir
- Catenate "{RomMapLoc}{ROMMap}" >> TestPerf.map ≥dev:null || set status 0
-
-
- #######################################################################
- # Build instructions and dependencies for the EditCDev cdev
- #
- # EditCdev is a sample Control Panel device (cdev) that
- # demonstrates the usage of the edit-related messages.
- # EditCdev demonstrates how to implement an editText item
- # in a Control Panel Device. It utilizes the new undo, cut, copy,
- # paste, and delete messages that are sent to cdevs in
- # response to user menu selections.
- #
- # It is comprised of two editText items that can be edited
- # and moved between via the mouse or tab key.
- #
-
- cdevObjs = EditCDev.c.o
-
- cdevLibs = "{Libraries}"Interface.o
-
- Destination = {SystemFolder}Control Panels:
-
- EditCDev ƒƒ {cdevObjs}
- Link -o {Targ} -rt cdev=-4064 -m TEXTCDEV {cdevObjs} {cdevLibs}
-
- EditCDev ƒƒ EditCDev.r
- Rez -o {Targ} EditCDev.r -t cdev -c hack -rd -append
-
- EditCDev ƒƒ {cdevObjs} EditCDev.r
- Setfile EditCDev -a B
- Duplicate -y EditCDev "{Destination}"
-
-
- #######################################################################
- # Build instructions and dependencies for the Sample application
- #
- # Sample is an example application that demonstrates how to
- # initialize the commonly used toolbox managers, operate
- # successfully under MultiFinder, handle desk accessories,
- # and create, grow, and zoom windows.
- #
- # It does not by any means demonstrate all the techniques
- # you need for a large application. In particular, Sample
- # does not cover exception handling, multiple windows/documents,
- # sophisticated memory management, printing, or undo. All of
- # these are vital parts of a normal full-sized application.
- #
- # This application is an example of the form of a Macintosh
- # application; it is NOT a template. It is NOT intended to be
- # used as a foundation for the next world-class, best-selling,
- # 600K application. A stick figure drawing of the human body may
- # be a good example of the form for a painting, but that does not
- # mean it should be used as the basis for the next Mona Lisa.
- #
- # We recommend that you review this program or TESample before
- # beginning a new application.
- #
- # You can define {SymOptions} as "-sym on" or "-sym off" for use with SADE
- # We also recommend requiring prototypes for all functions
-
- sampObjs = Sample.c.o
-
- sampLibs = "{Libraries}"MacRuntime.o ∂
- "{Libraries}"Interface.o
-
- Sample ƒƒ {sampObjs} Sample.r
- Link -o {Targ} {sampObjs} {sampLibs} {SymOptions}
- Rez -rd -o {Targ} Sample.r -append
- SetFile {Targ} -t APPL -c 'MOOS' -a B
-
-
-
- #######################################################################
- # Build instructions and dependencies for the SillyBalls application
- #
- # This is a very simple sample program that demonstrates how to use Color
- # QuickDraw. It is about two pages of code, and does nothing more than open
- # a color window and draw randomly colored ovals in the window.
- #
- # The purpose is to show how to get some initial results with Color QuickDraw.
- # It is a complete program and is very short to be as clear as possible.
- #
- # It does not have an Event Loop. It is not fully functional in the sense that
- # it does not do all the things you would expect a well behaved Macintosh
- # program to do, like size the window naturally, have an event loop, use menus,
- # etc.
- #
- # See Sample and TESample for the general structure and MultiFinder techniques that
- # we recommend that you use when building a new application.
- #
- # MPW 3.0 and later: We override the default COptions to turn on strict prototyping;
- # add '-proto strict' to your UserStartup when you tire of the warning from Make.
-
- sillyObs = SillyBalls.c.o
-
- sillyLibs = "{Libraries}"Interface.o ∂
- "{Libraries}"MacRuntime.o
-
- SillyBalls ƒƒ {sillyObs}
- Link -o {Targ} {sillyObs} {sillyLibs} {SymOptions}
- SetFile {Targ} -t APPL -c '????'
-
-
-
- #######################################################################
- # Build instructions and dependencies for the TESample application
- #
- # TESample is an example application that demonstrates how
- # to initialize the commonly used toolbox managers, operate
- # successfully under MultiFinder, handle desk accessories and
- # create, grow, and zoom windows. The fundamental TextEdit
- # toolbox calls and TextEdit autoscroll are demonstrated. It
- # also shows how to create and maintain scrollbar controls.
- #
- # It does not by any means demonstrate all the techniques you
- # need for a large application. In particular, Sample does not
- # cover exception handling, multiple windows/documents,
- # sophisticated memory management, printing, or undo. All of
- # these are vital parts of a normal full-sized application.
- #
- # This application is an example of the form of a Macintosh
- # application; it is NOT a template. It is NOT intended to be
- # used as a foundation for the next world-class, best-selling,
- # 600K application. A stick figure drawing of the human body may
- # be a good example of the form for a painting, but that does not
- # mean it should be used as the basis for the next Mona Lisa.
- #
- # We recommend that you review this program or Sample before
- # beginning a new application. Sample is a simple app. which doesn’t
- # use TextEdit or the Control Manager.
- #
- # You can define {SymOptions} as "-sym on" or "-sym off" for use with SADE
- # We also recommend requiring prototypes for all functions
-
- teObjs = TESample.c.o ∂
- TESampleGlue.a.o
-
- teLibs = "{Libraries}"MacRuntime.o ∂
- "{Libraries}"Interface.o
-
- TESample ƒƒ {teObjs} TESample.r
- Link -o {Targ} {teObjs} {teLibs} {SymOptions}
- Rez -rd -append -o {Targ} TESample.r
- SetFile {Targ} -t APPL -c 'MOOT' -a B
-
-
-
- #######################################################################
- # Build instructions and dependencies for the TubeTest application
- #
- # The TubeTest program is a simple demonstration of how to use the Palette
- # Manager in a color program. It has a special color palette that is associated
- # with the main window. The colors are animated using the Palette Manager
- # to give a flowing tube effect. The program is very simple, and the Palette
- # Manager and drawing parts are put in separate subroutines to make it easier
- # to figure out what is happening.
- #
- # The program is still a complete Macintosh application with a Main Event Loop,
- # so there is the extra code to run the MEL.
- #
- # There is a resource file that is necessary as well, to define the Menus, Window,
- # Dialog, and Palette resources used in the program.
- #
- # See Sample and TESample for the general structure and MultiFinder techniques that
- # we recommend that you use when building a new application.
- #
- # MPW 3.0 and later: We override the default COptions to turn on strict prototyping;
- # add '-r' to your UserStartup when you tire of the warning from Make.
-
- tubeObjs = TubeTest.c.o
-
- tubeLibs = "{Libraries}"Interface.o ∂
- "{Libraries}"MacRuntime.o
-
- TubeTest ƒƒ {tubeObjs} TubeTest.r
- Link -o {Targ} {tubeObjs} {tubeLibs}
- Rez -rd -o {Targ} TubeTest.r -append
- SetFile {Targ} -t APPL -c '????'
-